# sprite = codesters.Circle(x, y, diameter, "color")
sun = codesters.Circle(-150, 175, 75, "gold")
# sprite = codesters.Square(x, y, width, "color")
house = codesters.Square(0, -125, 250, "purple")
try:
tval1 = roof.get_x()
except:
tval1 = "DNE"
try:
tval2 = roof.get_y()
except:
tval2 = "DNE"
try:
tval3 = roof.get_name()
except:
tval3 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 0, "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you create a triangle and name it roof?")
t1.add_creative(tval1 != 0 and tval1 != "DNE" , "That's a good location!")
t2 = TestObjective()
t2.add_success(tval2 == 0, "Great Job!")
t2.add_failure(tval2 == "DNE", "Did you create a triangle and name it roof?")
t2.add_failure(tval2 != 0 and tval2 != "DNE", "That's a good location!")
t3 = TestObjective()
t3.add_success(tval3 == "triangleIso", "Great Job!")
t3.add_failure(tval3 == "DNE", "Did you create a triangle and name it roof?")
t3.add_creative(tval3 != "triangleIso" and tval3 != "DNE", "You added a " +tval3 + ". Did you mean to add a triangle?")
tester = TestManager()
tester.add_test_list([t1, t2, t3])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)